Create Customer Address
This API is used to create one or more customer addresses for an existing single account.
When sending a request to create multiple addresses in a single call, the result treats them as a single instance so that the result is either All Succeed, or All Fail.
| HTTP URL | |
|---|---|
| POST | /api/v2/customer/{id}/address |
Eligibility
The Requester is eligible to request to create addresses for its own sub-customers only (one level). The Requester is not allowed to create customer addresses on its own account level or for any other customers.
API Request
Request Structure
| Element | Type | M/O/CM | Description |
|---|---|---|---|
| address | Object | M | Array of customer addresses object. |
Address data objects
| Element | Type | M/O/CM | Description |
|---|---|---|---|
| type | String | O | Address type. ENUM: PRIVATE, SHIPPING, MAILING. Default: PRIVATE |
| street | String | CM | Street name. Mandatory if pobox (postal office box) is not provided |
| buildingNumber | String | CM | Building number on the street. Mandatory if pobox is not provided |
| buildingName | String | O | Building name (alias) if it exists |
| buildingFloor | String | O | Floor number in the building |
| zipCode | String | O | Zip postal code |
| apartmentNumber | String | O | Apartment number in the building |
| entrance | String | O | Entrance identifier. Can be a letter or number |
| city | String | O | City name |
| province | String | O | Province name |
| state | String | O | State name |
| country | String | O | Country name |
| pobox | String | CM | Postal Office Box number. Mandatory if street and streetNumber are not provided |
| salutation | String | O | Address representative salutation. ENUM: MR, MS, MISS, DR, PROF |
| fullName | String | O | Representative full name |
| title | String | O | Address representative title. ENUM: DR, PROF |
| company | String | O | Company name |
| emailAddress | String | O | Email address. Validated via Regular Expression |
| isPrimary | Boolean | O |
Determines whether the contact is primary or not.
|
API Response
Response Structure
| Parameter | Type | M/O/CM | Description |
|---|---|---|---|
| errorCode | String | O | Failure code. |
| errorMessage | String | O | Failure message. |
| content | Object | O | Array of main response body object displayed when an API call was successful. For a failure, it will be empty. |
| pageable | Object | O | Paging information object displayed when an API call was successful. For a failure, it will be empty. |
Content data objects
| Element | Type | M/O/CM | Description |
|---|---|---|---|
| requestId | UUID | M |
Request instance ID. To be used by external systems to query the call (operation) status:
|
Pageable data objects
| Element | Type | M/O/CM | Description |
|---|---|---|---|
| page | Numeric | M | Page number |
| size | Numeric | M | Page size. Number of requested elements per page |
| totalPages | Numeric | M | Total amount of available pages per requested page size |
| totalElements | Numeric | M | Total amount of retrieved elements |
Error Codes
In addition to the general success and failure codes, the following error codes are possible.
| Code | Message |
|---|---|
| GLOBAL_1001 | Service unavailable. Please try again |
Examples
Request Body
{
"address": [
{
"type": "private",
"street": "sixth avenue",
"buildingNumber": "987",
"buildingName": "Concord",
"buildingFloor": "1",
"zipCode": "123456",
"apartmentNumber": "14",
"entrance": "A",
"city": "Chicago",
"province": "",
"state": "Illinois",
"country": "USA",
"pobox": "",
"salutation": "",
"fullName": "",
"title": "",
"company": "",
"emailAddress": "",
"isPrimary": true
},
{
"type": "mailing",
"street": "fifth avenue",
"buildingNumber": "234",
"buildingName": "Concord",
"buildingFloor": "12",
"zipCode": "123456",
"apartmentNumber": "14",
"entrance": "A",
"city": "New York",
"province": "",
"state": "New York",
"country": "USA",
"pobox": "",
"salutation": "",
"fullName": "",
"title": "",
"company": "",
"emailAddress": "",
"isPrimary": false
}
]
}
Response Body: Success ACK
{
"errorCode": "",
"errorMessage": "",
"content": [
{
"requestId": "ff74dca6-8e7f-4b85-a42b-13860913b370"
}
],
"pageable": {
"page": 0,
"size": 10,
"totalPages": 1,
"totalElements": 1
}
}
Response Body: Failure NAK
{
"errorCode": "GLOBAL_1001",
"errorMessage": "Service unavailable. Please try again",
"content": "",
"pageable": ""
}